<%@ page import="com.apexedu.identity.security.CasLoginUtil" %>
<%@ page import="com.apexedu.identity.entity.TSysUser" %>
<%@ page import="com.apexedu.identity.IdConstants" %>
<%@ page import="com.apexedu.portal.constant.Constants" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    request.setAttribute("basePath", request.getContextPath());
    TSysUser user = (TSysUser) request.getSession().getAttribute(IdConstants.SESSION_USER);
    String type = (String) request.getSession().getAttribute("type");
    request.setAttribute("userid", user.getUserloginid());
    request.setAttribute("username", user.getUsername());
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="${basePath}/resources/css/mh.shgy.css" rel="stylesheet">
<script type="text/javascript" src="${basePath}/clientui/js/jquery-1.4.js"></script>
<script>
    var type = '<%=type%>';
    function execLogout() {
        if (window.confirm('确定要退出系统吗？')) {
            $.get("${basePath}/identity/ajaxlogin.action?act=logout", {q: (new Date()).getTime()}, function (data) {
                data = eval("(" + data + ")");
                if (data.msg == 'success') {
                    <%
	                if( CasLoginUtil.isSsoEnabled() ){
	                %>
                    	window.location.href = '<%=CasLoginUtil.getCasServerLogoutUrl()%>';
                    <%
                    }else{
                    %>
                    	window.location.href = '<%=request.getContextPath() %>?t=' + Math.round(new Date / 1000);
                    <%
                    }
                    %>
                } else {
                    alert(data.msg);
                }
            });
            setTimeout(function () {
                <%
                	if( CasLoginUtil.isSsoEnabled() ){
                %>
                		window.location.href = '<%=CasLoginUtil.getCasServerLogoutUrl()%>';
                <%
                	}else{
                %>
                		window.location.href = '<%=request.getContextPath() %>?t=' + Math.round(new Date / 1000);
                <%
                	}
                %>
            }, 1000);
        }
    }
</script>
<script type="text/javascript" src="${basePath}/resources/js/mh.shgy.index.js"></script>
<script type="text/javascript" src="${basePath}/resources/js/mh.js"></script>
<div id="head">
    <div id="headline">
        <div class="login">
            <a href="javascript:;" onclick="execLogout()" class="login_signout"> 注销 </a>
            <a href="${basePath}/s/uc/mh/up" class="login_signout" target="_blank"> 密码 </a>

            <div class="login_info"> ${username}</div>
            <%if ("admin".equals(user.getUserloginid())) {%>
            <a href="/identity/index.action?flag=true" target="_blank" class="login_glht"> 管理后台 </a>
            <%}%>
        </div>
        <%if ("admin".equals(user.getUserloginid())) {%>
        <div id="site">
            <select id="changeSite">
                <option value="ls">教职工站点</option>
                <option value="ld" <%if("ld".equals(type)){%>selected="selected" <%}%>>校领导站点</option>
                <option value="xs" <%if("xs".equals(type)){%>selected="selected" <%}%>>学生站点</option>
            </select>
        </div>
        <%}%>
    </div>
    <div id="title">
        <%if (Constants.MhUserType.LS.equals(type)) {%>
        <ul class="titleUl" style="width: 752px;">
            <li onclick="location.href='${basePath}/'" class="titleLi">首页</li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_GelsDWS7SjIc'"
                class="titleLi">教学工作
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_Kwc4zGl7xkQu'"
                class="titleLi">学生工作
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_Wr0sGv4qvIwT'"
                class="titleLi">日常办公
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_W5Z6gVEd5zDg'"
                class="titleLi">人事信息
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_z9U5u0Knnpxo'"
                class="titleLi">后勤信息
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_QH94MfEDkAY3'"
                class="titleLi">财务信息
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/w'" class="titleLi">流程中心</li>
        </ul>
        <%} else if (Constants.MhUserType.LD.equals(type)) {%>
        <ul class="titleUl" style="width: 658px;">
            <li onclick="location.href='${basePath}/'" class="titleLi">首页</li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_lzBF4iC6kpeS'"
                class="titleLi">学生工作
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_iILAmZ6azsRW'"
                class="titleLi">教学工作
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_QH94MfEDkAY3'"
                class="titleLi">财务管理
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_W5Z6gVEd5zDg'"
                class="titleLi">人力资源
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_Doiljj9RIh72'"
                class="titleLi">后勤资产
            </li>
            <li onclick="location.href='${basePath}/s/uc/shgy/s/navserver_WAR_nj612portlet_INSTANCE_u1t5dnxR5Itu'"
                class="titleLi">行政办公
            </li>
        </ul>
        <%} else if (Constants.MhUserType.XS.equals(type)) {%>
        <ul class="titleUl" style="width: 564px;">
        </ul>
        <%}%>
    </div>
</div>
